public class ReplayCarDao{

	public void add(BlackBox bb) {
		try {
			String tmp_order = "";
			for (String order : bb.getOrder()) {
				tmp_order += order + " ";
			}
			String sql = "insert into replay_car "
						+ "(start_xpoint, start_ypoint, end_xpoint, end_ypoint, `order`) "
						+ "values("+bb.getStart().getXpoint()+","+bb.getStart().getYpoint()+","+bb.getEnd().getXpoint()+","+bb.getEnd().getYpoint()+",'"+tmp_order.trim()+"');";
			DataBaseUtil.add(sql);
		} catch(Exception e) {
			e.printStackTrace();
		}
		
	}

	public BlackBox query(int id) {
		BlackBox bb = null;
		try {
			String sql = "select * from replay_car where id=" + id + ";";
			bb = DataBaseUtil.query(sql);

		} catch(Exception e) {
			e.printStackTrace();
		}
		
		return bb;
	}
}